package com.wocao.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.wocao.entity.ReqBody;
import com.wocao.entity.SysMenu;
import com.wocao.entity.SysUser;
import org.springframework.security.core.GrantedAuthority;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

/**
 * 用户信息表 服务类
 */
public interface SysUserService extends IService<SysUser> {

    //分页所有用户
    Page<SysUser> allPage(Page<SysUser> page, ReqBody reqBody);

    //修改用户
    void updateUser(SysUser sysUser);

    //添加用户
    void addUser(SysUser sysUser);

    //批量删除
    void batchRemoveUser(Integer[] userIds) throws Exception;

    /**
     * 根据用户名查询授权集合
     */
    List<GrantedAuthority> getAuthoritiesByUsername(String username);

    /**
     * 按用户名查询权限和子权限
     */
    List<SysMenu> getSysMenusWithChildrenByUsername(String username);

    /**
     * 按用户名查询用户信息
     */
    SysUser getPersonalInformationByUsername(String username);

}
